package site.wlwsjsx.iot_backend.mapper;

import org.apache.ibatis.annotations.Mapper;
import site.wlwsjsx.iot_backend.entity.UserInfo;

import java.util.LinkedList;

@Mapper
public interface UserMapper {
    int insertUser(UserInfo userInfo);

    int deleteUserById(int id);

    int updateUser(UserInfo userInfo);

    UserInfo selectUserByUsername(String username);

    /**
     * 根据用户名查询用户ID
     *
     * @param username 用户名
     * @return 用户ID，未找到返回null
     */
    Integer selectIdByUsername(String username);

    UserInfo selectUserById(int id);

    LinkedList<UserInfo> selectAllUser();
}
